# -*- coding: utf8 -*-
import sqlite3
from uniform_filters import uniform_filters
from gauss_filters import gauss_filters
from statistic_filters import statistic_filters
import file_control
import os
import string

#създаваме базата
conn = sqlite3.connect(r"F:\Filter Experimet\Results DB\texture_filter_experiment.db")
c = conn.cursor()

###########################################
# FILTTERS
###########################################
i = 1
rows = [(i, 'ORG_', 'ORIGINAL', 0, 0)]
i = i + 1

#UNIFORM
for filter_info in uniform_filters:
    rows.append((i, 'UNI_'+str(filter_info['SIZE'])+"_",'UNIFORM', filter_info['SIZE'], 0))
    i = i + 1

#GAUSS
for filter_info in gauss_filters:
    rows.append((i, 'G_'+str(filter_info['SIZE'])+"_"+str(filter_info['SIGMA'])+"_",'GAUSS', filter_info['SIZE'], filter_info['SIGMA']))
    i = i + 1

#STATISTIC
for filter_info in statistic_filters:
	rows.append((i, 'MIN_'+str(filter_info['TYPE'])+"_"+str(filter_info['SIZE'])+"_",'MIN', filter_info['SIZE'], filter_info['TYPE']))
	i = i + 1
	rows.append((i, 'MAX_'+str(filter_info['TYPE'])+"_"+str(filter_info['SIZE'])+"_",'MAX', filter_info['SIZE'], filter_info['TYPE']))
	i = i + 1
	rows.append((i, 'MEDIAN_'+str(filter_info['TYPE'])+"_"+str(filter_info['SIZE'])+"_",'MEDIAN', filter_info['SIZE'], filter_info['TYPE']))
	i = i + 1

c = conn.cursor()
c.executemany('insert into filters values (?,?,?,?,?)', rows )
conn.commit()
print 'OK'